package com.bba.manager.as.controller;

import com.bba.manager.as.service.IRepairPartsService;
import com.bba.manager.common.model.as.RepairParts;
import com.bba.manager.common.util.ResponseVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 汽车维修所需配件表 前端控制器
 * </p>
 *
 * @author SYANDZZY
 * @since 2025-08-12
 */
@RestController
@RequestMapping("/repairParts")
public class RepairPartsController {
    @Autowired
    private IRepairPartsService repairPartsService;


    /**
     * 创建维修单配件表
     */
    @PostMapping("/save")
    public ResponseVO save(@RequestBody RepairParts repairParts) {
        repairPartsService.saveRepairParts(repairParts);
        return ResponseVO.success(repairParts);
    }
    /**
     * 根据维修单号查询查询
     */
    @PostMapping("/list")
    public ResponseVO query(@RequestParam Long id) {
        List<RepairParts> result = repairPartsService.ListById(id);
        return ResponseVO.success(result);
    }

}
